package com.sqf.soft.controller;

import com.sqf.soft.entity.User;
import com.sqf.soft.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("user")
public class UserController {

    private IUserService userService;

    @Autowired
    public UserController(IUserService userService) {
        this.userService = userService;
    }

    @RequestMapping("findUserByLogin")
    public Map<String, Object> findUserByLogin(@RequestBody User user) {
        return userService.findUserByLogin(user);
    }

    @RequestMapping("createUser")
    public Map<String, Object> createUser(@RequestBody User user) {
        return userService.createUser(user);
    }
}
